package com.shangcheng.orders.feign;


import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "orders")
@RequestMapping("/cart")
public interface CartFeign {

    @RequestMapping(value = "/add")
    public Result addCart(@RequestParam(name = "id") Long id,
                          @RequestParam(name = "num") Integer num,
                          @RequestParam(name = "username") String username);

    @RequestMapping(value = "/list")
    public Map list(@RequestParam(name = "username") String username);

    @RequestMapping(value = "/dele")
    public Result deleteCart(@RequestParam(name = "id") Long id);

}
